package com.multi.thread.chapter03.demo15;

/**
 *	join()方法的作用是等待线程对象销毁
 */
public class MyThread extends Thread {

	@Override
	public void run() {
		try {
			int secondValue = (int) (Math.random() * 10000);
			System.out.println(secondValue);
			Thread.sleep(secondValue);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) throws InterruptedException {
		MyThread thread = new MyThread();
		thread.start();
		thread.join();
		System.out.println("我想当thread对象执行完毕后我再执行，我做到了!");
	}
}
